package com.ihr360.payroll.model.dto.salary.report.embedded;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.google.common.collect.Lists;
import com.ihr360.commons.lang.CollectionUtils;
import lombok.Data;

import java.io.Serializable;
import java.util.List;
import java.util.stream.Collectors;

/**
 * Created by Eric on 2018/4/16/016.
 */
@Data
public class SalaryPlanStaffSnapshot implements Serializable {
    private List<SalaryStaffSnapshot> staffList;

    @JsonIgnore
    public List<String> getStaffIdList() {
        if (CollectionUtils.isEmpty(staffList)) {
            return Lists.newArrayList();
        }
        return staffList.stream().map(SalaryStaffSnapshot::getStaffId).collect(Collectors.toList());
    }
}
